﻿namespace EFS.RC.CC.Presences
{
	/// <summary>
	/// End point presence
	/// </summary>
	internal abstract class Deployment<EndPointDeployment> : EFS.Common.ISelfDescriptor
		where EndPointDeployment : EFS.RC.CC.Deployment.Entities.EndPoint
	{
		#region Private components
		
		/// Deployment
		private EndPointDeployment endPointDeployment = null;

		// Registering list
		private EFS.RC.CC.Presences.EndPoints.Registrar endPointsPresencesRegistrar = null;

		#endregion

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="endPointsPresencesRegistrar"></param>
		/// <param name="endPointDeployment"></param>
		public Deployment(EFS.RC.CC.Presences.EndPoints.Registrar endPointsPresencesRegistrar, EndPointDeployment endPointDeployment)
		{
			// check
			EFS.Common.Verify.Reference(endPointsPresencesRegistrar, "endPointsPresencesRegistrar");
			EFS.Common.Verify.Reference(endPointDeployment, "endPointDeployment");

			// keep 
			this.endPointDeployment = endPointDeployment;
			this.endPointsPresencesRegistrar = endPointsPresencesRegistrar;
		}

		/// <summary>
		/// Describe this object into a nice formated string
		/// </summary>
		/// <returns></returns>
		public virtual System.String Describe()
		{
			return System.String.Format("EFS.RC.CC.Presences.Deployment [{0}]", endPointDeployment.Describe());
		}

		/// List
		public EFS.RC.CC.Presences.EndPoints.Registrar EndPointsPresencesRegistrar
		{
			get { return endPointsPresencesRegistrar; }
		}

		/// Deployment
		public EndPointDeployment PresenceEndPointDeployment
		{
			get { return endPointDeployment; }
		}
	}
}
